#include "common.h"

int res;
int ret = 0;
int tat;
void dfs(vector<int>& nums, int index)
{
	if (index == nums.size())
	{
		if (ret == tat)
		{
			res++;
		}
		return;
	}
	ret += nums[index];
	dfs(nums, index + 1);
	ret -= nums[index] * 2;
	dfs(nums, index + 1);
	ret += nums[index];
}
int findTargetSumWays(vector<int>& nums, int target)
{
	tat = target;
	dfs(nums, 0);
	return res;
}